package com.bysj.system.controller;

import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.SysPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Set;

@RestController
public class UserRegisterController {

    @Autowired
    private SysPermissionService permissionService;

    @Autowired
    private SysLoginService loginService;

    @PostMapping("/rent/user/register")
    public AjaxResult login(@RequestBody SysUser sysUser) {
        AjaxResult ajax = AjaxResult.success();
        boolean register = loginService.register(sysUser);
        if(register){
            return ajax.put("msg","注册成功");
        }
        return ajax.put("msg","注册失败");
    }

}
